<CFCOMPONENT output="false">
	
	<CFFUNCTION name="init" access="public" returntype="void">
		<cfargument name="URL" type="struct" required="true">
		<cfargument name="FORM" type="struct" required="true">
		<cfargument name="target" type="string" required="true">
		<cfargument name="xhr" type="string" required="true">
		<!--- Init Object to Discover the Requested Route --->
		<cfset var routeObj = CreateObject("Component", "ColdRails.Core.getRoute").init(target=ARGUMENTS.target)>
		
		<!--- Init Object to Create Param Object --->
		<cfset var paramObj = CreateObject("Component", "ColdRails.Core.createParams").init(FORM=ARGUMENTS.FORM,URL=ARGUMENTS.URL,XHR=ARGUMENTS.XHR)>
		
		<!--- Set Private Variable Method (Set to Either GET, POST, or XHR) --->
		<cfset variables.Method = CreateObject("Component", "ColdRails.Core.createMethod").init(FORM=ARGUMENTS.FORM,URL=ARGUMENTS.URL,XHR=ARGUMENTS.XHR)>
		
		<!--- Set Private Variable Params (Contains all URL & FORM Variables) --->
		<cfset variables.Params = paramObj.getParams()>
		
		<!--- Set Private Variable Route (Contains All Data Contained in the URL String Outside the QS) --->
		<cfset variables.Route = routeObj.getRoute()>
	</CFFUNCTION>
	
	<CFFUNCTION name="callController" access="public" returntype="void">
		<cfset var controller = CreateObject("Component", "app.controller." & variables.Route.controller).init(Route = variables.Route, Params = variables.Params, Method = variables.Method)>
		<cfset controller[variables.Route.action]()>
		<cfset variables.data = controller.getData()>
		<cfset variables.layout = contoller.getLayout()>
		<cfset variables.mimeType = controller.getMimeType()>
		<cfset variables.viewModule = controller.getViewModule()>
		<cfset variables.viewMethod = controller.getViewMethod()>
	</CFFUNCTION>
	
	<CFFUNCTION name="callView" access="public" returntype="void">
		<cfset var view = CreateObject("Component", "app.view." & variables.viewModule).init()>
		<cfset view.setRoute(route = variables.Route)>
		<cfset view.setParams(params = variables.Params)>
		<cfset view.setData(data = variables.data)>
		<cfset view.setMimeType(mimeType = variables.mimeType)>
		<cfset view.setLayout(layout = variables.layout)>
		<cfset view[variables.viewMethod]()>
	</CFFUNCTION>

</CFCOMPONENT>